import { createRouter , createWebHashHistory } from 'vue-router'

import login from "@/components/login/login"
import Register from "@/components/login/register"

import Index from "@/components/page/index"
import home from '@/components/page/DetailPage/Home'
import User from '@/components/page/DetailPage/user'
import userDetail from '@/components/page/DetailPage/assist/userDetail'
import basePet from '@/components/page/DetailPage/basePet'
import Pet from '@/components/page/DetailPage/pet'
import PetDetail from '@/components/page/DetailPage/assist/PetDetail'
import Introduction from '@/components/page/DetailPage/introduction'
import Coordinate from '@/components/page/DetailPage/assist/coordinate'
import communicate from '@/components/page/DetailPage/communicate'
import Foster from '@/components/page/DetailPage/foster'
import FosterDetaile from '@/components/page/DetailPage/assist/fosterDetaile'
import ChatRoom from '@/components/page/DetailPage/assist/ChatRoom'
import catalog from '@/components/page/DetailPage/catalog'

import goods from '@/components/page/DetailPage/goods'
import goodsDetail from '@/components/page/DetailPage/assist/goodsDetail'
import cart from '@/components/page/DetailPage/cart'
import Case from '@/components/page/DetailPage/case'
import Business from '@/components/page/DetailPage/business'
import hospitalInfo from '@/components/page/DetailPage/hospitalInfo'
import UpDoor from '@/components/page/DetailPage/UpDoor'
import coupons from '@/components/page/DetailPage/coupons'

import Log from '@/components/page/DetailPage/log.vue'

const routerHistory = createWebHashHistory()

const router = createRouter({
  history:routerHistory,
  routes: [ 
    {
      path:'/',
      name:Index,
      component:Index,
      children:[
        {
          path:'/home',
          name:home,
          component:home
        },{
          path:'/log',
          name:Log,
          component:Log
        },{
          path:'/user',
          name:User,
          component:User
        },{
          path:"/UpDoor",
          name:UpDoor,
          component:UpDoor
        },{
          path:"/userDetail",
          name:userDetail,
          component:userDetail
        },{
          path:"/basePet",
          name:basePet,
          component:basePet
        },{
          path:"/Pet",
          name:Pet,
          component:Pet
        },{
          path:'/PetDetail',
          name:PetDetail,
          component:PetDetail
        },{
          path:'/Introduction',
          name:Introduction,
          component:Introduction
        },{
          path:'/coordinate',
          name:Coordinate,
          component:Coordinate
        },{
          path:'/coupons',
          name:coupons,
          component:coupons
        },{
          path:'/communicate',
          name:communicate,
          component:communicate
        },{
          path:'/foster',
          name:Foster,
          component:Foster
        },{
          path:'/fosterDetaile',
          name:FosterDetaile,
          component:FosterDetaile
        },{
          path:'/catalog',
          name:catalog,
          component:catalog
        },{
          path:'/ChatRoom',
          name:ChatRoom,
          component:ChatRoom
        },{
          path:'/goods',
          name:goods,
          component:goods
        },{
          path:'/goodsDetail',
          name:goodsDetail,
          component:goodsDetail
        },{
          path:'/cart',
          name:cart,
          component:cart
        },{
          path:'/Case',
          name:Case,
          component:Case
        },{
          path:'/Business',
          name:Business,
          component:Business
        },{
          path:'/hospitalInfo',
          name:hospitalInfo,
          component:hospitalInfo
        }
      ]
    },             
    {
      path:'/login',
      name:login,
      component:login
    },{
      path:'/register',
      name:Register,
      component:Register
    },{
      path: '/404',
      name: 'PageNotExist',
      component: () => import('@/components/page/404'),
    }
  ]
})


// {
//   path: "/:catchAll(.*)", // 不识别的path自动匹配404
//   redirect: '/404',
// }

export default router;